<?php

function AfficherForm() {
   echo '<div id="titre"><h2>Entrer votre message</h2><form method="post" action="' . htmlentities($_SERVER['PHP_SELF']).'"></div>';

    echo '<div id="form">
  	<table>
        <tr>
          <td>Produit:</td> 
          <td><input type="text" name="label" size="30" /></td> 
        </tr>
        <tr>
	  <td colspan="2"><input type="submit" name="msg" value="Submit" /></td> 
        </tr>
      </table>
    </form></div>';
 
}


function debut() {echo "<html><head></head><body>";  }
  
function fin() {echo "</body></html>";   }


debut();
afficherForm();

if (isset($_POST['msg']) and isset($_POST['label'])) {
	echo '<div id="result"><pre>';
	echo $_POST['label'];
	echo '</pre></div>';
	
  }
fin();
?>   
